package lol.clann.minecraft.springboot.plugin.module.devtools.commands;

import lol.clann.minecraft.springboot.api.annotation.command.Command;
import lol.clann.minecraft.springboot.api.annotation.command.CommandDefine;
import lol.clann.minecraft.springboot.api.annotation.command.Sender;
import lol.clann.minecraft.springboot.api.annotation.condition.ConditionalOnMinecraftVersion;
import lol.clann.minecraft.springboot.api.annotation.condition.MinecraftVersionRange;
import lol.clann.minecraft.springboot.plugin.module.devtools.ListItemUtils;
import org.bukkit.SoundCategory;
import org.bukkit.command.CommandSender;

import java.util.Arrays;
import java.util.Objects;

/**
 *
 * @author pyz
 * @date 2019/6/11 11:17 PM
 */
@ConditionalOnMinecraftVersion(@MinecraftVersionRange(min = 11100))
@CommandDefine(name = "devtools")
public class ListSoundCategoryCommand {
    @Command(showArgs = "listSoundCategory", des = "列出所有SoundCategory")
    private boolean listSoundCategory(@Sender CommandSender sender) throws Exception {
        ListItemUtils.listInSingleLine(sender, "%s", Arrays.stream(SoundCategory.values()).filter(Objects::nonNull).map(i -> i.name()));
        return true;
    }
}
